#include <iostream>
#include <iomanip>
#include <purg.h>

// Define a generator
typedef purg::combined_generator_tmpl<purg::sha1_stream , purg::rand>  generator;

int main ( int argc , char **argv )
{
  // instantiate a generator
  generator  gen ( 0 , 0 , 0 );

  // create a random double on [0,1)
  purg::random_variable<double , generator>  rand_double_01 ( 0. , 1. , gen );
  
  // create a random double on [10,20)
  purg::random_variable<double , generator>  rand_double_1020 ( 10. , 20. , gen );

  // write out 10 random numbers on [0,1)
  std::cout << "10 numbers on [0,1)" << std::endl;
  for ( size_t i = 0 ; i != 10 ; i++ )
  {
    double cur_rand = rand_double_01;
    std::cout << "  " << std::setprecision ( 20 ) << cur_rand << std::endl;
  }

  // write out 10 random numbers on [10,20)
  std::cout << "10 numbers on [10,20)" << std::endl;
  for ( size_t i = 0 ; i != 10 ; i++ )
  {
    double cur_rand = rand_double_1020;
    std::cout << "  " << std::setprecision ( 20 ) << cur_rand << std::endl;
  }

  // create a random size_t on [1.E9,2.E9)
  purg::random_variable<size_t , generator> rand_size_t ( 1000000000 , 2000000000 , gen );

  // write out 10 random numbers from this variable
  std::cout << "10 integers on [1.E9 , 2.E9]" << std::endl;
  for ( size_t i = 0 ; i != 10 ; i++ )
  {
    size_t cur_irand = rand_size_t;
    std::cout << "  " << cur_irand << std::endl;
  }
}
